package com.aaron;


import com.aaron.config.RpcServiceConfig;
import com.aaron.proxy.RpcClientProxy;
import com.aaron.remoting.transport.RpcRequestTransport;
import com.aaron.remoting.transport.socket.SocketRpcClient;

public class SocketClientMain {
    public static void main(String[] args) {

        RpcRequestTransport rpcRequestTransport = new SocketRpcClient();
        RpcServiceConfig rpcServiceConfig = new RpcServiceConfig();

        // 动态代理（使用的是jdk动态代理）
        RpcClientProxy rpcClientProxy = new RpcClientProxy(rpcRequestTransport, rpcServiceConfig);
        HelloService helloService = rpcClientProxy.getProxy(HelloService.class);

        // s使用动态代理来调用服务端的服务
        String hello = helloService.hello(new Hello("111", "222"));

        System.out.println(hello);
    }
}
